package com.yzf.demo.demo.annotation.ioc;

import java.util.HashMap;

/**
 * Created by 于占峰 on 2020/3/28/028.
 * 模拟IOC容器
 */
public class IOCContainer {
    //用于装入实体类的map容器
    private static HashMap container = new HashMap();

    //装入
    public static void putBean(String key, Object value) {
        //如果已经存在则不再装入
        //if(container.containsKey(key)) return;
        container.put(key, value);
    }

    //取出
    public static Object getBean(String key) {
        return container.get(key);
    }
}
